package com.example.curriculum.service;

import com.example.curriculum.pojo.User;
import com.example.curriculum.repository.UserRepository;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class UserService implements IUserService {
    @Resource
    private UserRepository repo;

    @Override
    public User add(User user) {
        repo.save(user);
        return user;
    }

    @Override
    public User select(String user_id) {
        return repo.findById(user_id);
    }

    @Override
    public User update(User user) {
        repo.update(user);
        return user;
    }

    @Override
    public void delete(String User_id) {
        repo.deleteById(User_id);
    }
}
